package streams

import (
	"github.com/docker/docker/pkg/term"
	"io"
)

// Out 是DockerCli用来编写正常程序输出的输出流
// Out is an output stream used by the DockerCli to write normal program output
type Out struct {
	commonStream
	out io.Writer
}

// NewOut 从Writer返回一个新的Out对象
// NewOut returns a new Out object from a Writer
func NewOut(out io.Writer) *Out {
	fd, isTerminal := term.GetFdInfo(out)
	return &Out{commonStream: commonStream{fd: fd, isTerminal: isTerminal}, out: out}
}
